package com.da.javatest.niuke.baodian;

/**
 * @author chenlida
 * @date 2020/10/9 14:55
 * https://www.nowcoder.com/practice/83073edaa76b4d179ee0366518a58dba?tpId=8&tags=&title=&diffculty=0&judgeStatus=0&rp=1
 */
public class C33Ants {
    /**
     * 每只蚂蚁可以趴两个方向，多边形就是2的n次方，只有都是顺时针或者逆时针的情况才不会碰撞
     */
    public double antsCollision(int n) {
        double pow = Math.pow(2, n);
        return (pow - 2) / pow;
    }
}
